<%@ Page Language="C#" MasterPageFile="~/ripple.master" AutoEventWireup="true" CodeFile="chat.aspx.cs"
    Inherits="chat" Title="Untitled Page" %>

<asp:Content ID="newChatMsg" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">

    <script type="text/javascript">
        function getMessages()
        {
           chat.GetMessages(GetMessages_callback); 
        }
        function GetMessages_callback(res)
        {
            ChatHistory.innerHTML = ChatHistory.innerHTML + res.value;
        }
        function sendMessage(msg)
        {
           chat.SendMessage(msg, SendMessage_callback); 
        }
        function SendMessage_callback(res)
        {
        
        }
        

    </script>

    <div id="AjaxPanel" style="display:none">
        <div id="ChatHistory" style="width: 343px; height: 219px; overflow: scroll">
        </div>
        <input id="btnGetMessages" type="button" value="get" onclick="javascript:getMessages();" />
        <br />
        <input id="txtNewMsg" type="text" style="width: 286px" />
        <input id="btnSendMessage" onclick="javascript:sendMessage(txtNewMsg.value);" type="button"
            value="Send" />
        <br />
        <input id="Button3" type="button" value="test" onclick="javascript:getServerTime();" /></div>
    <br />
    <h1>
        <asp:Label ID="lblInfo" runat="server"></asp:Label></h1>
    The only snag for the time being is that you have to refresh the chat history manually
    by pressing the button below. But trust me! Automated refresh will be available
    soon. (I have very little time to do the HTML part right now.)<br />
    &nbsp;<asp:Panel ID="Panel1" runat="server" Height="206px" Width="396px" ScrollBars="vertical">
        <asp:Label ID="Label1" runat="server"></asp:Label></asp:Panel>
    <asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Refresh Chat History Manually" /><br />
    <br />
    <asp:TextBox ID="TextBox1" runat="server" Width="255px"></asp:TextBox>
    <asp:Button ID="Button2" runat="server" OnClick="Button2_Click" Text="Send Message" />
</asp:Content>
